package week_home_work02;

import java.util.Scanner;

/**
 * @author zdl
 * @date 2024/11/23
 */
public class Demo67 {
    public static void main(String[] args) {
        //计算一个数的平方根并判断它是否是整数。
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数字:");
        int num = sc.nextInt();
        int target = 0;
        for (int i = 1; i <= num; i++) {
            if (i * i > num) {
                target = i - 1;
                break;
            }
        }
        System.out.println(num + "数的平方根为:" + target);
    }
}
